package com.xinghanlaser.applet.base.oss.model;

import com.xinghanlaser.applet.base.oss.service.BucketType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class BigFileUploadPartParam {
    /**
     * 分片文件
     */
    @NotNull(message = "分片文件不能为空",groups = {BucketType.defaultBucket.class, BucketType.specificBucket.class})
    private MultipartFile objectPart;

    /**
     * 上传标识ID
     */
    @NotBlank(message = "uploadId不能为空",groups = {BucketType.defaultBucket.class, BucketType.specificBucket.class})
    private String uploadId;

    /**
     * 桶名
     */
    @NotBlank(message = "bucketName不能为空",groups = {BucketType.specificBucket.class})
    private String bucketName;

    /**
     * 分片序号
     */
    @Min(value = 1,message = "分片序号不能小于1",groups = {BucketType.defaultBucket.class, BucketType.specificBucket.class})
    private Integer partNumber;

    /**
     * 是否为最后一片
     */
    @NotNull(message = "lastPart不能为空",groups = {BucketType.defaultBucket.class, BucketType.specificBucket.class})
    private Boolean lastPart;

    /**
     * 对象名
     */
    @NotBlank(message = "objectName不能为空",groups = {BucketType.defaultBucket.class, BucketType.specificBucket.class})
    private String objectName;

}
